<template>
    <div>
      <aplid-base-crud ref="crud" class="w-100" v-bind="baseConfig">
        <template #menuColumn="{row}">
            <el-button v-if="row.filesStatus==0||row.filesStatus==2"  text type="primary" @click="toSend(row)">发送</el-button>
        </template>
        <template #DetialDialog="{row}">
            <Detail :rowData="row"></Detail>
        </template>
    </aplid-base-crud>
    </div>
  </template>
  
  <script setup lang="ts">
  import { ref,nextTick } from 'vue'
  import {baseConfig} from './config'
  import Detail from './components/detail/index.vue'
  import apiMod from '@/apiMod/index'
  import { ElMessage } from 'element-plus'

  const crud = ref(null)
  const handleRefreshPage = () => {
  nextTick(() => {
    crud.value.refreshChange({}, false)
  })
}
  // 发送档案
  const toSend = (row) =>{
    let params = {
      id:row.id,
			oldman:row.oldman,
			idCard:row.idCard,
      organizationName:row.organizationName,
      creditCode:row.creditCode
    }
    apiMod.view_bscApplicationFile_send(params).then(res=>{
      if(res.code==0){
        handleRefreshPage()
        ElMessage({
          message: '发送成功',
          type: 'success',
        })
      }
    })
  }
  
  </script>
  <style scoped lang="scss">
  </style>